<?php
class OtherAction extends BaseAction{
	public function __construct(){
		parent::__construct();
	
		$this->assign('cssPath',__ROOT__.'/Public/'.GROUP_NAME.'/'.'SPG'.'/css');
		$this->assign('jsPath',__ROOT__.'/Public/'.GROUP_NAME.'/'.'SPG'.'/js');
		$this->assign('imagePath',__ROOT__.'/Public/'.GROUP_NAME.'/'.'SPG'.'/image');
		$this->assign('fontPath',__ROOT__.'/Public/'.GROUP_NAME.'/'.'SPG'.'/fonts');
	}
	
	public  function question(){
		if(IS_POST){
			$input 				= $this->_post('input');
			$openid 			= $this->_post('openid');

			Log::write("input=".$input.", openid=".$openid, LOG::INFO);
			
			if($input==0){
				$data['grptype']='帮公司预定';
			}
			else if($input==1){
				$data['grptype']='帮同事预定';
			}
			else{
				$data['grptype']='帮客户预定';
			}
			M('subscriber')->where(array('openid'=>$openid))->save($data);
				
			echo'{"success":1}';
			exit;
		}
		$this->display();
	}
}
?>